package com.cf.expensetracker.command;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
import com.beust.jcommander.Parameters;
import lombok.Data;

/**
 * Copyright(C) 2025- com.cf
 * FileName:    DelCmd
 * Author:      cf
 * Date:        2025/1/22 11:23
 * Description: Delete command
 */
@Data
@Parameters(commandNames = "delete", commandDescription = "Delete a expense")
public class DeleteCmd {
    @Parameter(names = "--id", description = "Id of the expense", required = true)
    private Integer id;

    public void validate() throws ParameterException {
        if (id < 1) {
            throw new ParameterException("The id must be greater than 0.");
        }
    }
}
